package com.example.zhilongzhang.constructionpayapp.activity;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.example.zhilongzhang.constructionpayapp.R;
import com.example.zhilongzhang.constructionpayapp.base.BaseActivity;
import com.example.zhilongzhang.constructionpayapp.bean.RecordListBean;

public class BillActivity extends BaseActivity {
    TextView tvAddress,tvPrice,tvTime,tvNumber,tvNote,tvAddress2,tvState,tvSlip;
    RecordListBean.DataEntity item;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_bill);
        tvAddress=findViewById(R.id.tv_bill_address);
        tvSlip=findViewById(R.id.tv_bill_slip);
        tvPrice=findViewById(R.id.tv_bill_price);
        tvTime=findViewById(R.id.tv_bill_time);
        tvNumber=findViewById(R.id.tv_bill_number);
        tvNote=findViewById(R.id.tv_bill_note);
        tvAddress2=findViewById(R.id.tv_bill_address2);
        tvState=findViewById(R.id.tv_bill_state);
        item= (RecordListBean.DataEntity) getIntent().getSerializableExtra("item");
        initData();
    }
    private void initData(){
        findViewById(R.id.left).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
        if (item!=null){
            tvAddress.setText(item.getRemitter());
            tvAddress2.setText(item.getRemitter());
            tvPrice.setText("+"+String.valueOf(item.getAmount()));
            tvTime.setText(item.getPaymentTime());
            tvNumber.setText(item.getPaymentCode());
            tvState.setText(item.getComments());
            tvSlip.setText("否");
        }
    }
}
